//
//  VC3NavigationSecond.swift
//  ChapterAll
//
//  Created by Kevin on 2020/4/22.
//  Copyright © 2020 Kevin. All rights reserved.
//

import UIKit

class VC3NavigationSecond: UIViewController {
    
    override func viewDidLoad() {
        super.viewDidLoad()
        
        let action = UIBarButtonItem(title: "action", style: .plain, target: self, action: #selector(clickPop))
        navigationItem.leftBarButtonItem = action
        
        let camera = UIBarButtonItem(barButtonSystemItem: .camera, target: nil, action: nil)
        navigationItem.rightBarButtonItem = camera
        
        /*
         * 在根上生效
         */
        navigationController?.isToolbarHidden = false
        navigationController?.toolbar.tintColor = UIColor.blue
        toolbarItems = [camera,camera]
        
        // 点击屏幕时，隐藏
        navigationController?.hidesBarsOnTap = true
        // 屏幕上滑动时，隐藏
        navigationController?.hidesBarsOnSwipe = true
        // 键盘弹出时，隐藏
        navigationController?.hidesBarsWhenKeyboardAppears = true
        // 横屏时，隐藏
        navigationController?.hidesBarsWhenVerticallyCompact = true
    }
    
    @objc func clickPop() -> Void {
        navigationController?.popViewController(animated: true)
    }
}
